import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/carrier/listCarrier',
    method: 'post',
    data: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-product/carrier/detailCarrier',
    method: 'post',
    params: {
      id
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-product/carrier/deleteCarrier',
    method: 'post',
    data: ids
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-product/carrier/addCarrier',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-product/carrier/updateCarrier',
    method: 'post',
    data: row
  });
};

export const getInuseInfo = (list) => {
  return request({
    url: '/api/mes-product/carrier/listCarrier/workOrder',
    method: 'post',
    data: list
  });
};

export const unbindingCarrier = (list) => {
  return request({
    url: '/api/mes-product/carrier/unbinding/carrier',
    method: 'post',
    data: list
  });
};

// 载具容量分页接口
export const carrierPageList = (current, size, params) => {
  return request({
    url: '/api/mes-product/carrier/capacity/page',
    method: 'post',
    data: {
      ...params,
      current,
      size
    }
  });
};

// 载具容量添加修改接口
export const carrierSave = (row) => {
  return request({
    url: '/api/mes-product/carrier/capacity/saveOrUpdate',
    method: 'post',
    data: row
  });
};

// 载具容量删除接口
export const carrierRemove = (ids) => {
  return request({
    url: '/api/mes-product/carrier/capacity/batch/delete',
    method: 'post',
    data: ids
  });
};
